package com.ycMc.service.impl;

import com.ycMc.domain.ProductBrand;
import com.ycMc.mapper.ProductBrandMapper;
import com.ycMc.service.BaseService;
import com.ycMc.service.ProductBrandService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * Created by libo2 on 2017/8/23.
 */
@Service
public class ProductBrandServiceImpl extends BaseService implements ProductBrandService {

    @Autowired
    private ProductBrandMapper productBrandMapper;

    @Override
    public void delete(int id) {
        productBrandMapper.delete(id);
    }

    @Override
    public List<ProductBrand> selectAll() {

        return         productBrandMapper.select(null,0,0,0);
    }

    @Override
    public void insert(ProductBrand productBrand) {
        productBrand.setId(0);
        productBrand.setCreateTime(System.currentTimeMillis());
        productBrandMapper.insert(productBrand);

    }

    @Override
    public void update(ProductBrand productBrand) {
        productBrandMapper.update(productBrand);
    }


    @Override
    public ProductBrand selectOne(int id) {
        return productBrandMapper.selectOne(id);
    }
}
